<?php

/**
 * Students form base class.
 *
 * @method Students getObject() Returns the current form's model object
 *
 * @package    polyannuaire
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseStudentsForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'year'          => new sfWidgetFormInputText(),
      'school_id'     => new sfWidgetFormPropelChoice(array('model' => 'School', 'add_empty' => true)),
      'first_name'    => new sfWidgetFormInputText(),
      'name'          => new sfWidgetFormInputText(),
      'company'       => new sfWidgetFormInputText(),
      'area_company'  => new sfWidgetFormInputText(),
      'pro_phone'     => new sfWidgetFormInputText(),
      'mobile_phone'  => new sfWidgetFormInputText(),
      'e_mail_pro'    => new sfWidgetFormInputText(),
      'service'       => new sfWidgetFormInputText(),
      'adress_pro1'   => new sfWidgetFormInputText(),
      'adress_pro2'   => new sfWidgetFormInputText(),
      'post_code'     => new sfWidgetFormInputText(),
      'position'      => new sfWidgetFormInputText(),
      'description'   => new sfWidgetFormTextarea(),
      'ville_pro'     => new sfWidgetFormInputText(),
      'country'       => new sfWidgetFormInputText(),
      'private_phone' => new sfWidgetFormInputText(),
      'private_mail'  => new sfWidgetFormInputText(),
      'updated_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'Students', 'column' => 'id', 'required' => false)),
      'year'          => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'school_id'     => new sfValidatorPropelChoice(array('model' => 'School', 'column' => 'id', 'required' => false)),
      'first_name'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'name'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'company'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'area_company'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pro_phone'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'mobile_phone'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'e_mail_pro'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'service'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'adress_pro1'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'adress_pro2'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'post_code'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'position'      => new sfValidatorString(array('max_length' => 255)),
      'description'   => new sfValidatorString(),
      'ville_pro'     => new sfValidatorString(array('max_length' => 255)),
      'country'       => new sfValidatorString(array('max_length' => 255)),
      'private_phone' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'private_mail'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'updated_at'    => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('students[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Students';
  }


}
